home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ** $VER: ShiftRGB 3.0, IE Arexx script ** Image Engineer Macro script ** Copyright © by Patrik M Nydensten ** 14/1 1997 Stockholm/Sweden ** ** Swaps/copies brightness data in the R, G and B channels. */ Options results Signal on error if arg()==0 then exit 'FORM "Shift RGB" "Ok|Cancel"', ' TEXT,"Swaps and/or copies image data between colour channels."', ' TEXT,"Red channel will use data from"', ' CYCLE,"Channel:","Red|Green|Blue",0', ' TEXT,"Green channel will use data from"', ' CYCLE,"Channel:","Red|Green|Blue",1', ' TEXT,"Blue channel will use data from"', ' CYCLE,"Channel:","Red|Green|Blue",2' parse var result ok c.0 c.1 c.2 if ok = 0 then exit /* Process */ MergeImage = '' do i = 0 to 2 if c.i = 0 then 'BRIGHTNESS' arg(1) '-255' 'GREEN BLUE' if c.i = 1 then 'BRIGHTNESS' arg(1) '-255' 'RED BLUE' if c.i = 2 then 'BRIGHTNESS' arg(1) '-255' 'RED GREEN' Image = RESULT if (i*85-c.i*85) ~= 0 then do 'HUE' Image (i*85-c.i*85) HueImage = RESULT 'CLOSE' Image end else HueImage = Image if MergeImage ~= '' then do 'MARK' HueImage 'PRIMARY' 'MARK' MergeImage 'SECONDARY' 'COMPOSITE' 0 0 'ADD' Image = RESULT 'CLOSE' HueImage 'CLOSE' MergeImage MergeImage = Image end else MergeImage = HueImage end exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ Error: if RC=5 then do IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' ' OK ' exit end